<%@ page contentType="text/html; charset=UTF-8"%>
<%@include file="/html/portlet/chart/admin/init.jsp"%>

<%
	String redirect = ParamUtil.getString(request, "redirect");	
	Option option = null;
	long optionId = ParamUtil.getLong(request, "optionId");
	if (optionId > 0) {
		option = OptionLocalServiceUtil.getOption(optionId);
	}
	
	String[] _CATEGORY_NAMES = {""};
	String[] mainSections = {"chart.baseconfig","chart.dsconfig"};
	String[][] categorySections = {mainSections};
%>
<portlet:actionURL name='addOrUpdateChartOption' var="editChartOptionURL" />


<liferay-ui:header
	backURL="<%= redirect %>"
	localizeTitle="<%= (option == null) %>"
	title='<%= (option == null) ? "chart.option.new" : option.getName() %>'
/>
<aui:form action="<%= editChartOptionURL %>" name="<portlet:namespace />fm">
	<aui:model-context bean="<%= option %>" model="<%= Option.class %>" />
	<aui:input type="hidden" name="optionId" />
	<liferay-ui:form-navigator
			categoryNames="<%= _CATEGORY_NAMES %>"
			categorySections="<%= categorySections %>"
			jspPath="/html/portlet/chart/admin/option/"
		/>
</aui:form>
